﻿@model eShop.Web.Admin.Models.NewsListModel

@section header{
    <title>新闻列表</title>
    <link type="text/css" rel="stylesheet" href="/administration/css/site.css" />
    <link type="text/css" rel="stylesheet" href="/administration/css/style.css" />
    <script type="text/javascript" src="/administration/scripts/jquery.js"></script>
    <script type="text/javascript" src="/administration/scripts/showlist.js"></script>
}

@section body{
    <h1 class="rightH1">
        新闻管理 &gt;&gt; 新闻列表
        <div class="right">
            <a href="@Url.Action("addnews")" class="menuBT"><img src="/administration/images/add.jpg" />添加新闻</a>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </h1>
    @using (Html.BeginForm("newslist", "news"))
    {

        <div class="dataListSearch">
            <table height="32">
                <tbody>
                    <tr>
                        <td width="35"><img id="searchImg" src="/administration/images/search1.gif" /></td>
                        <td>新闻类型：</td>
                        <td width="90">@Html.DropDownListFor(x => x.NewsTypeId, Model.NewsTypeList)</td>
                        <td>新闻标题：</td>
                        <td width="130">@Html.TextBox("NewsTitle", Model.NewsTitle, new { height = "18" })</td>
                        <td>
                            <input id="SearchNews" name="SearchNews" type="image" class="searchBut submit" src="/administration/images/s.jpg" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div style="padding-left:15px;">
            <table class="tablelist">
                <thead>
                    <tr>
                        <th width="40" align="left"><input type="checkbox" id="allSelect" /></th>
                        <th width="60" align="left">编号</th>
                        <th width="150" align="left">类型</th>
                        <th align="left">标题</th>
                        <th width="60" align="left">显示</th>
                        <th width="60" align="left">置顶</th>
                        <th width="60" align="left">置首</th>
                        <th width="60" align="left">排序</th>
                        <th width="96" align="left">管理操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (DataRow row in Model.NewsList.Rows)
                    {
                        <tr>
                            <td align="left"><input type="checkbox" value="@row["newsid"]" selectItem="true" name="newsIdList" /></td>
                            <td>@row["newsid"]</td>
                            <td>@row["name"]</td>
                            <td>@row["title"]</td>
                            <td>
                                @if (row["isshow"].ToString() == "0")
                                {
                                    @:否
      }
                                else
                                {
                                    @:是
      }
                            </td>
                            <td>
                                @if (row["istop"].ToString() == "0")
                                {
                                    @:否
      }
                                else
                                {
                                    @:是
      }
                            </td>
                            <td>
                                @if (row["ishome"].ToString() == "0")
                                {
                                    @:否
      }
                                else
                                {
                                    @:是
      }
                            </td>
                            <td>@row["displayorder"]</td>
                            <td>
                                @Html.ActionLink("[编辑]", "editnews", new { newsId = row["newsid"] }, new { @class = "editOperate" })
                                @Html.ActionLink("[删除]", "delnews", new { newsIdList = row["newsid"] }, new { @class = "deleteOperate" })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
        <div class="dataListEdit">
            <a href="#" delUrl="@Url.Action("delnews")" class="batch batchDel">批量删除</a>
            <div class="page">
                @Html.AdminPager(Model.PageModel)
            </div>
        </div>
    }
}